package com.woniuxy.controller;

import com.woniuxy.dao.TempMapper;
import com.woniuxy.pojo.Car;
import com.woniuxy.pojo.Dictionary;
import com.woniuxy.pojo.Driver;
import com.woniuxy.pojo.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class TempController extends BaseController{
    private Logger logger= LoggerFactory.getLogger(this.getClass());

    @Autowired
    TempMapper tempMapper;

    @GetMapping("/temp/cars")
    public List<Car> cars(){
        return tempMapper.selectAllCars();
    }

    @GetMapping("/temp/drivers")
    public List<Driver> drivers(){
        return tempMapper.selectAllDrivers();
    }

    @GetMapping("/temp/options")
    public List<Dictionary> options(){
        return tempMapper.selectAllOptions();
    }

    @GetMapping("/temp/vaos")
    public List<Dictionary> vaos(){
        return tempMapper.selectAllVaos();
    }

    @GetMapping("/temp/users")
    public List<User> users(){
        return tempMapper.selectAllUsers();
    }

    @GetMapping("/temp/insTypes")
    public List<Dictionary> insTypes(){
        return tempMapper.selectDictionarysByPid(TempMapper.INS_TYPE);
    }

    @GetMapping("/temp/insUnits")
    public List<Dictionary> insUnits(){
        return tempMapper.selectDictionarysByPid(TempMapper.INS_UNIT);
    }
}
